package com.test.daily.leetcode.y2022.m07.day0714.v05;

import java.util.HashMap;

/**
 * @descriptions:
 * @author: Tom
 * @date: 2022/7/14 下午 04:18
 * @version: 1.0
 */
public class Solution {

    public static class Node1{
        int pass;
        int end;
        Node1[] nexts = new Node1[26];
    }
    public static class Trie1{
        public Node1 root;
        public Trie1(){
            this.root = new Node1();
        }
        public  void insert(String chs){
            if(chs == null){
                return;
            }
            char[] strs = chs.toCharArray();
            Node1 node = root;
            node.pass++;
            int index = 0;
            for (int i = 0; i < strs.length; i++) {
                index = strs[i] - 'a';
                if(node.nexts[index] == null){
                    node.nexts[index] = new Node1();
                }
                node.pass++;
                node = node.nexts[index];
            }
            node.end++;
        }
    }

}
